package jrdcom.com.jrdmovie;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import jrdcom.com.jrdmovie.Fragment.MainFragment;
import jrdcom.com.jrdmovie.Fragment.TopMovieFragment;
import jrdcom.com.jrdmovie.JrdHttpMethod.Beans.JrdSubjectBean;
import jrdcom.com.jrdmovie.JrdHttpMethod.JrdHttpMethod;
import jrdcom.com.jrdmovie.JrdHttpMethod.JrdServiceInterface;
import jrdcom.com.jrdmovie.JrdHttpMethod.JrdSubscriber.JrdOnNextListener;
import jrdcom.com.jrdmovie.JrdHttpMethod.JrdSubscriber.ProgressSubscriber;
import retrofit2.Retrofit;

public class MainActivity extends AppCompatActivity {

    //@Bind(R.id.btn_Test)
    //Button btnTest;

    //private Retrofit jrdRetrofit;
    private ProgressSubscriber<JrdSubjectBean> jrdSubjectBeanProgressSubscriber;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_main_activity);
        //ButterKnife.bind(this);

        getFragmentManager()
                .beginTransaction()
                .replace(R.id.activity_main_RL, new TopMovieFragment())
                .addToBackStack(TopMovieFragment.TAG)
                .commit();
    }

    @Override
    public void onBackPressed() {
        if(getFragmentManager().getBackStackEntryCount()> 0){
            getFragmentManager().popBackStack();
        }else{
            super.onBackPressed();
        }
    }
}
